<template>
  <div class="wrapper">
    <VTable	
      :isShow="false"
      :border="true"										
      :tablesize="size"
      :tablecurrent="current"
      :tabletotal="total"
      :table-data="tableList"
      :table-label="tableListLabel"					                        
      @tableSizeChange="sizeChange"
      @tableCurrentImportDeptChange="currentChange"
    >
    </VTable>
  </div>
</template>

<script>
  import VTable from '@/components/charts/table'

  export default {
    name: "Dialog",
    components: {
      VTable
    },
    props: {
      tableList: {
        type: Array,
        default: []
      },
      tableListLabel: {
        type: Array,       
        required: true
      }
    },
    data() {
      return {
        size: 10,
        current: 1,
        total: 0
      }
    },
    created() {
      this.current = 1
      this.total = 0
    },
    methods: {
      currentChange(val) {
        this.current = val
      },
      sizeChange(val) {
        this.size = val
      }
    },
    watch: {
      tableList: {
        handler: function(newVal) {
          if(newVal.length) {
            this.total = newVal.length           
          }
        }
      }
    }
  }
</script>

<style scoped lang="scss">
</style>